Repository navigation
feat(blocker): refuse cookie consent, never accept it - #331
Merged
Merged
Conversation
Filter-list rules that answer a consent prompt with accept on the user's behalf are dropped at conversion: trusted-click-element rules whose target names an accept, agree or allow control (in the lists' languages, or a consent platform's accept button), set-cookie and storage-item rules that store an accepted answer, and those restoring a saved consent record (an id or TCF string) whose answer cannot be read. Rules that reject, keep necessary only, continue without accepting or close stay, as do the lists' hiding and scroll unlock. While cookie notices are hidden, every site also runs a refuse-consent scriptlet that answers the consent platform the page loads through its documented API, only while the visitor has not answered: OneTrust RejectAll on OneTrustGroupsUpdated, Cookiebot submitCustomConsent on CookiebotOnDialogDisplay, Usercentrics v3/v2 denyAllConsents on UC_UI_INITIALIZED, and Didomi setUserDisagreeToAll through its ready queue once its script has loaded. It stands down with the blocker, for a paused site, and in subframes.
…utlives its removal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The built-in blocker no longer accepts cookie consent on the user's behalf, and refuses it where the page's consent platform has a documented API.
Never accept (list conversion)
The cookie-notice lists Lilo enables by default carry
trusted-click-elementrules that click accept buttons (#didomi-notice-agree-buttonon hundreds of sites, OneTrust, Cookiebot, Sourcepointsp_choice_type_11, Quantcastmode="primary"...) andset-cookie/ storage-item rules that store an accepted answer. Accepting then loads the site's ad and tracker stack.FilterListConverter.acceptsConsentdrops such a rule at conversion, generically, from the rule's own arguments::not(). Refusal words (reject, necessary only, continue without, revoke, select...) win over accept words, so "accept only necessary" is kept. A sequence is dropped when any step accepts.On the default lists (uBO filters, EasyList, EasyPrivacy, uBO privacy and badware, liste_fr, EasyList Cookie, uBO cookie annoyances, fetched 2026-11-07):
trusted-click-elementset-cookie/ storage itemsThe lists' hiding and scroll-unlock rules stay, so the banner stays hidden; it is just never answered with accept.
Refuse (refuse-consent scriptlet)
While the cookie-notice lists are on, every site runs a
refuse-consentscriptlet (a*entry of the scriptlet table, so it stands down with the blocker, for a paused site, and for a site's#@#+js()). In the top document only, it waits on each platform's own ready signal and refuses only while the visitor has not answered:OneTrustGroupsUpdatedwindow eventOneTrust.IsAlertBoxClosed()false:OneTrust.RejectAll()CookiebotOnDialogDisplaywindow eventCookiebot.hasResponsefalse:submitCustomConsent(false, false, false),hide()UC_UI_INITIALIZEDwindow eventisConsentRequired():denyAllConsents(), thencloseCmp()/closeCMP()load), thendidomiOnReadyshouldUserStatusBeCollected():setUserDisagreeToAll()Sourcepoint, Quantcast Choice, TrustArc and Axeptio document no reject-all call (the TCF
__tcfapihas none either): they are left to the lists' hiding and reject clicks.Nothing polls and nothing runs at idle: three window listeners and a capture
loadlistener that reads one property per loaded resource until Didomi appears. Nothing is added to the page: no global, the Didomi callback is bound so it prints as native code, andPageWorldTestsnow runs the scriptlet.Bench
make page-bench ROUNDS=12(#329, not part of this PR), tables converted from the same list texts before and after. Lilo tab minus plain web view, medians, up to the load event:Consent read from the page after load (Didomi
getCurrentUserStatus,__tcfapi getTCData). Every page stays scrollable (nooverflow: hiddenon html or body). The bench stops at the load event, so it misses most of what an accept loads afterwards; allocine's rise is its Dailymotion player frame, which now starts before the load event once consent is answered early, where the accept click came after it.Tests
FilterListConverterTests.testConsentIsNeverAcceptedOnTheUsersBehalf: accept clicks and stored acceptances dropped, rejects, necessary-only, continue-without, close and opaque values kept.BlockerLayersTests.testConsentIsRefusedNeverAccepted: throughFilterListServiceinto a tab on a made-up example.com page with a fake OneTrust: the accept click is gone, the reject click runs, the platform is refused; with cookie notices shown, it is not.PageWorldTests: the refuse-consent scriptlet leaves no trace.scriptlets.test.ts: each platform, answered visitors left alone, subframes and paused sites.